package com.yunhe.authority.domain.company;

import com.yunhe.authority.domain.office.Office;
import com.yunhe.common.annotation.EnumItemCode;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.neo4j.ogm.annotation.GeneratedValue;
import org.neo4j.ogm.annotation.Id;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Property;

import com.yunhe.authority.domain.option.IndustryCategory;
import com.yunhe.authority.domain.option.AcceptanceSituation;
import com.yunhe.authority.domain.option.EstablishSoundManagementLedger;
import com.yunhe.authority.domain.option.PaymentStatus;
import com.yunhe.authority.domain.option.ProtectionEquipmentStatus;
import com.yunhe.authority.domain.option.SafetyGrade;
import com.yunhe.authority.domain.option.AdministrativeSanction;
import org.neo4j.ogm.annotation.*;

import java.util.List;

import java.util.List;

/**
 * 企业对象
 * @author liuronglei
 */
@NodeEntity
@Data
public class Company implements Comparable<Company> {

    /*************************基础信息*************************/
    @Id
    @GeneratedValue
    @ApiModelProperty(value = "Id")
    private Long id;

    @Property(name = "code")
    @ApiModelProperty(value = "code")
    private Long code;

    @Property(name = "name")
    @ApiModelProperty(value = "name")
    private String name;

    @Property(name = "abbreviation")
    @ApiModelProperty(value = "简称")
    private String abbreviation;

    /**企业全称*/
    @Property(name = "title")
    @ApiModelProperty(value = "企业全称")
    private String title;

    @Property(name = "sn")
    @ApiModelProperty(value = "排序字段")
    private String sn;

    /**绑定的房源*/
//    @Relationship(type = "HAS_OFFICE")
    @ApiModelProperty(value = "绑定的房源")
    private List<Office> offices;

    /**归属园区(真实园区)*/
    @Property
    @ApiModelProperty(value = "归属园区(真实园区)")
    private String stationTitle;

    /**归属园区ID(真实园区ID)*/
    @Property
    @ApiModelProperty(value = "归属园区ID(真实园区ID)")
    private Long readStationId;

    /**面积*/
    @Property
    @ApiModelProperty(value = "面积")
    private double area;

    /**入驻时间*/
    @Property
    @ApiModelProperty(value = "入驻时间")
    private String leaseTime;

    /**缴费日期*/
    @Property
    @ApiModelProperty(value = "缴费日期")
    private String paymentDate;

    /**租赁期限*/
    @Property
    @ApiModelProperty(value = "租赁期限")
    private String leaseDueTime;

    /**租赁期限开始*/
    @Property
    @ApiModelProperty(value = "租赁期限开始")
    private String leaseStartTime;

    /**租赁期限结束*/
    @Property
    @ApiModelProperty(value = "租赁期限结束")
    private String leaseEndTime;


    /**************************工商信息***************************/
    /**统一社会信用代码*/
    @Property
    @ApiModelProperty(value = "统一社会信用代码")
    private String unifiedSocialCreditCode;

    /**企业法人名称*/
    @Property
    @ApiModelProperty(value = "企业法人名称")
    private String legalPerson;

    @ApiModelProperty(value = "企业注册地址编码(省市区)")
    @Property(name = "areaAddress")
    private String areaAddress;

    @ApiModelProperty(value = "企业注册地址title(省市区)")
    @EnumItemCode(code = "Area",fieldTitle = "areaAddress")
    private String areaAddressTitle;

    /**企业注册地址*/
    @Property
    @ApiModelProperty(value = "企业注册地址")
    private String companyRegisteredAddress;

    /**企业行政区域*/
    @Property
    @ApiModelProperty(value = "企业行政区域")
    private String companyAdministrativeRegions;

    /**注册资本*/
    @Property
    @ApiModelProperty(value = "注册资本")
    private String registeredCapital;

    /**企业类型*/
    @Property
    @ApiModelProperty(value = "企业类型")
    private String typeOfEnterprise;

    /**营业期限*/
    @Property
    @ApiModelProperty(value = "营业期限")
    private String operatingPeriod;

    /**注册时间*/
    @Property
    @ApiModelProperty(value = "注册时间")
    private String registrationTime;

    /***********************联系方式*****************************/

    /**联系人*/
    @Property
    @ApiModelProperty(value = "联系人")
    private String chargePerson;

    /**联系方式*/
    @Property
    @ApiModelProperty(value = "联系方式")
    private String chargePersonPhone;

    /**联系人职务*/
    @Property
    @ApiModelProperty(value = "联系人职务")
    private String personPosition;

    /**邮箱*/
    @Property
    @ApiModelProperty(value = "邮箱")
    private String emailAddress;

    /***********************功能性字段*****************************/

    /**项目id*/
    @ApiModelProperty(value = "项目id")
    private Long intentionId;

    /**企业状态 0在园 1离园*/
    @ApiModelProperty(value = "企业状态 0在园 1离园")
    private String companyStatus;

    /**创建时间*/
    @ApiModelProperty(value = "创建时间")
    private String creatTime;

    /**更新时间*/
    @ApiModelProperty(value = "更新时间")
    private String updateTime;


    @Override
    public int compareTo(Company o) {
        if (this.sn == null) {
            return -1;
        } else if (o == null || o.getSn() == null) {
            return 1;
        }
        return this.sn.compareTo(o.getSn());
    }
}
